* figures 4

use SectionRatio.dta

encode reporter, gen(id)
egen ind=group( id year)
ren Vold S
keep reporter year section ind S
reshape wide S, i(ind) j(section)
drop ind
sort  reporter year

save temp.dta, replace

use Diversification.dta, clear

keep if reduced==1

egen mpop=mean(pop), by(reporter)
drop if mpop<1000000

sort  reporter year
merge  reporter year using temp.dta

* figure 4a
label var S5 "share of mineral products in total exports (Section 5)" 
lowess S5 GDPpcppp, lineopts(lcolor(red) lwidth(thick))

*figure 4b
label var S6 "share of Chemical products products in total exports (Section 6)" 
lowess S6 GDPpcppp if S6<0.45, lineopts(lcolor(red) lwidth(thick))

*figure 4f
label var S16 "share of Machinery in total exports (Section 16)" 
lowess S16 GDPpcppp, lineopts(lcolor(red) lwidth(thick))

*figure 4d
label var S11 "share of textiles in total exports (Section 11)" 
lowess S11 GDPpcppp if S11<0.6, lineopts(lcolor(red) lwidth(thick))

*figure 4e
label var S17 "share of Vehicles in total exports (Section 17)" 
lowess S17 GDPpcppp if S17<0.3, lineopts(lcolor(red) lwidth(thick))

*figure 4c
label var S8 "share of Raw Hides and Skins in total exports (Section 8)" 
lowess S8 GDPpcppp if S8<0.1, lineopts(lcolor(red) lwidth(thick))


